package com.hly.musicbackground.model.user.rest;

import com.hly.musicbackground.model.user.params.UpdatePasswordParams;
import com.hly.musicbackground.model.user.service.UserPasswordService;
import com.hly.musicbackground.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户密码
 * */
@RestController
@RequestMapping("/api/userPassword")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@Api(tags = "密码")
public class UserPasswordController {

    private final UserPasswordService userPasswordService;

    /**
     * 修改密码
     * */
    @PostMapping("/updatePassword")
    @ApiOperation(value = "修改/找回密码")
    public Result updatePassword(@RequestBody UpdatePasswordParams params){
        userPasswordService.updatePassword(params);
        return Result.ok();
    }

}
